var $;
var from;
var code;
var pic;
var menu;
layui.use(['form', 'colorpicker', 'layer'], function () {
  $ = layui.$;
  from = layui.form;

})
function imglist(wellid, dbname) {
  var list = "";

  //身份验证
  // var getoken = GetToken(dataobj);
  if (getoken != false) {
    $.ajax({
      type: "post",
      url: api_address + "/gd/getimage?wellid=" + wellid + "&dbname=" + dbname,
      async: false,
      headers: {
        Authorization: getoken
      },
      contentType: 'application/json;',
      success: function (res) {
        var resdata = JSON.parse(res);
        if (resdata.code == 200) {
          list = resdata.data;
        }
      }
    })
  }
  for (let i = 0; i < list.length; i++) {
    menu = $("<img id='age' src='data:image/jpeg;base64," + list[i].pic + "' title='" + list[i].code + "'>")
    menu.css({
      "margin-left": "20px",
      "margin-top": "10px"
    })
    $("#img").append(menu);
    menu.on('click', "", function () {
      code = $(this).attr('title')
      pic = $(this).attr('src');
      $("img").css({
        border: "none"
      })
      $(this).css({
        border: "2px solid red"
      })
    })
  }
}
var resdate = function () {
  return { code, pic };
}